using System;
using System.Collections.Generic;
using System.Text;
using Mpi.Common.Collections;

namespace Xeml.Document
{
    public class IndividualsCollection : ObservableIdCollectionBase<Individual,int>
    {

        private IndividualsPool _pool;
        public IndividualsPool Pool
        {
            get
            {
                return _pool;
            }
        }

        public IndividualsCollection()
        {
        }

        public IndividualsCollection(IndividualsPool owner)
        {
            _pool = owner;
        }

        protected override int GetIdentifiere(Individual item)
        {
            return item.Id;
        }

        protected override void SetOwner(Individual item)
        {
            item.Collection = this;
        }

        protected override void RemoveOwner(Individual item)
        {
            item.Collection = null;
        }
    }
}
